import './assets/main.css'

import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import 'virtual:svg-icons-register'
import 'element-plus/dist/index.css'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
// 创建 Pinia 实例
const pinia = createPinia()
// 使用持久化插件
pinia.use(piniaPluginPersistedstate)
const app = createApp(App)
//全局挂载src/components目录下的所有组件
const arr = import.meta.glob(`./components/**/index.vue`)
for (const path in arr) {
  const name = path.replace('./components/', '').replace('/index.vue', '')
  app.component(name, (arr[path] as any).default)
}
app.use(pinia)
app.use(router)
app.mount('#app')
